using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using TrueSync;

namespace HEFramework
{
    public class TestWindowEditor : EditorWindow, IHasCustomMenu
    {
        private static TestWindowEditor window;

        private Vector2 scropllPos;

        /// <summary>
        /// Unity菜单选项附加
        /// </summary>
        [MenuItem("测试/调试面板", false, 0)]
        static void Open()
        {
            window = GetWindow<TestWindowEditor>("TestWindowEditor");
            //默认浮动内嵌模式
            //自动聚焦
            window.Focus();
            window.Show(true);
        }

        public void AddItemsToMenu(GenericMenu menu)
        {
        }

        void OnGUI()
        {
            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button("调试", GUILayout.Width(250)))
            {
                var camera=GameObject.Find("Main").transform.Find("SceneCamera").GetComponent<Camera>();
                Vector3 p = camera.WorldToScreenPoint(new Vector3(0, 0, 0));
                UnityEngine.Debug.Log(p);
            }

            GUILayout.EndHorizontal();
        }
    }
}